﻿namespace Model
{
    #region usings

    using System;

    using Common;

    #endregion

    public class Person : ICloneable<Person>
    {
        #region Properties

        public Guid Id { get; set; }

        public string Name { get; set; }

        #endregion

        #region Implemented Interfaces

        #region ICloneable<Person>

        public Person Clone()
        {
            return new Person { Id = Id, Name = Name };
        }

        #endregion

        #endregion

        public void Update(Person person)
        {
            if (Id != person.Id)
            {
                throw new InvalidOperationException("Persons with different id's could not be updated.");
            }

            Name = person.Name;
        }
    }
}